<?php
    
    // Carrega a View Topo

    $this->loadView("index/top");
    
?>

<div class="row-fluid">

    <?php 
    
        $remove_ok = Session::get("remove-ok");
    
        if( !empty( $remove_ok ) ): 
        
    ?>
    
        <div class="alert alert-success">Contato deletado com sucesso. =)</div>
    
    <?php 
    
    // Remove a sessão
    
    Session::delete("remove-ok");    
    
    endif;
    
    ?>    
    
<div>

    <table class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>Nome</th>
        <th>Telefone</th>
        <th>E-mail</th>
        <th class="operacoes">Atualizar</th>
        <th class="operacoes">Remover</th>
    </tr>
    </thead>
    <tbody>
        
    <?php foreach( $contatos as $contato ) : ?>
        
        <tr>
            <td><?=$contato['nome'];?></td>
            <td><?=$contato['telefone'];?></td>
            <td><?=$contato['email'];?></td>
            <td class="center">
                <a class="c-atualizar" href="<?=SITE_URL;?>/contato/exibir/<?=$contato['id'];?>" title="Atualizar dados"><img src="<?=IMG_URL;?>/update.png"></a>
            </td>
            <td class="center">
                <a class="c-remover" href="<?=SITE_URL;?>/contato/remover/<?=$contato['id'];?>" title="Remover"><img src="<?=IMG_URL;?>/delete.png"></a>
            </td>                
        </tr>
        
    <?php endforeach; ?>
    
    </tbody>
    </table>


</div>


</div>

<?php
    
    // Carrega a View Rodapé

    $this->loadView("index/footer");
    
?>